package com.example.wallet.utils

import com.example.wallet.R
import com.example.wallet.db.UserInfoManager
import com.example.wallet.global.AppGlobals

//选择币种
fun selectorIcon(): String {

    val userInfo = UserInfoManager.userInfoManager.getUserInfoWrapper()?.userInfo

    val cml = AppGlobals.getApplication().getString(R.string.wallet_cml)

    val arl = AppGlobals.getApplication().getString(R.string.wallet_arl)

    val invitationCode = (userInfo?.invitationCode ?: "")

    return when {
        invitationCode.startsWith(cml) -> cml
        invitationCode.startsWith(arl) -> arl
        else -> cml
    }


}

//选择币种(母币)
fun selectorMotherIcon(): String {

    val userInfo = UserInfoManager.userInfoManager.getUserInfoWrapper()?.userInfo

    val cml = AppGlobals.getApplication().getString(R.string.wallet_s_cml)

    val arl = AppGlobals.getApplication().getString(R.string.wallet_s_arl)

    val invitationCode = (userInfo?.invitationCode ?: "")

    return when {
        invitationCode.startsWith(cml) -> cml
        invitationCode.startsWith(arl) -> arl
        else -> cml
    }


}